package com.langfeiyes.pattern.strategy.demo;

/**
 * 美团App
 */
public class MeituanApp2 {
    //订单支付
    public void orderPay(int type, int money){

        if(IPayStrategy.PAY_WECHAT == type){
            new WeChatPayStrategy().pay(money);
        }else if(IPayStrategy.PAY_ALI == type){
            new AliPayStrategy().pay(money);
        }else if(IPayStrategy.PAY_UNION == type){
            new UnionStrategy().pay(money);
        }else{
            throw new RuntimeException("支付失败");
        }
    }
}
